package com.kaifamiao.month04.day21.homework;

import java.util.Iterator;
import java.util.TreeSet;

public class PhoenixTest {

    public static void main(String[] args) {

        TreeSet<Phoenix> set = new TreeSet<>();
        Phoenix p1 = new Phoenix(21, "张三", '男');
        Phoenix p2 = new Phoenix(24, "李四", '女');
        Phoenix p3 = new Phoenix(23, "王五", '女');
        Phoenix p4 = new Phoenix(26, "孙六", '男');
        Phoenix p5 = new Phoenix(27, "赵七", '男');
        set.add(p1);
        set.add(p2);
        set.add(p3);
        set.add(p4);
        set.add(p5);
        Iterator<Phoenix> it = set.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }
    }
}
